package com.misboot.document.client.fallbackFactory;

import cn.ewsd.common.controller.BaseController;
import com.misboot.document.client.FormClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;


/**
 * misboot-message相关接口 模块降级处理
 *
 * @Author 湖南佐佑时代科技有限公司
 * @Version 5.4.21
 * @Email service@zuoyo.com
 * @Date 2022-06-16 13:31:39
 */
@Component
public class FormClientFallbackFactory extends BaseController implements FallbackFactory<FormClient> {

    private static final Logger logger = LoggerFactory.getLogger(FormClientFallbackFactory.class);

    @Override
    public FormClient create(Throwable throwable) {
        logger.error("消息中心模块服务调用失败:{}", throwable.getMessage());
        return new FormClient() {


            @Override
            public Object saveOfDocumentFowForm(String url, String formUuid, String beforeTemplateUuid, String nowTemplateUuid, String status) {
                return null;
            }
        };
    }
}
